import React,{ useMemo,useState } from 'react'

export default function App() {
    const [count,setCount] = useState(0);
    const [value,setValue] = useState("");
    const treatCount = useMemo(() => {
        console.log('treatCount');
        return count + 10;
    },[count])
    return (
        <div>
            treatCount: {treatCount} <br/>
            count: {count}<button onClick={() => setCount(count + 1)}>点击</button>
            <br/>
            <input 
                type="text"
                value={value}
                onInput={(e) => {
                    setValue(e.target.value)
                }}
            />
        </div>
    )
}
